#字符串压缩 aaabbcaaddd -> a3b2c1a2d3

str1 = input("请输入一个字符串:")
str2 = ""
count = 1
for s in range(1,len(str1)):
    if str1[s] == str1[s-1]:
        count += 1
    else:
        str2 += str1[s-1] + str(count)
        count = 1
str2 += str1[-1] + str(count)
print(str2)
